home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-1.iso / Files / Util / M / MacDOS 3.0.sit / MacDOS 3.0 ƒ / executables / MacDOS 3.0.rsrc / TEXT_146_FOR.txt < prev    next >
Encoding:
Text File  |  1995-04-09  |  1.1 KB  |  23 lines

  1. Executes a command for each file in a set.
  2.  
  3. FOR %var [/L] IN (set) DO [command [parameters] | BEGIN]
  4.  
  5.   %var       specifies a parameter name.
  6.   /L         does not convert to upper case the filenames. This switch
  7.              can be in any position before the "DO".
  8.   set        consists of one or more items. Each item is a filename (possibly
  9.              wildcarded) or a directory name. File and directory names
  10.              can be preceded by a volume and path spec.
  11.   command    is the command to be carried out for each file and can be
  12.              the name of a batch file (possibly with volume and path spec).
  13.   parameters are passed to the command or batch program being executed for
  14.              each file.
  15.  
  16. FOR %var IN (set) DO BEGIN
  17.   is only allowed within a batch program. The lines following the FOR up
  18.   to the corresponding "NEXT var" are executed for each file in the set.
  19.   In this case, a global variable is created and the commands within the
  20.   loop must refer to %var% (rather than %var) to obtain the current file
  21.   name. It is up to the user to remove the variable after completing the
  22.   batch program or within the program after exiting the FOR loop.
  23.